package io;

/**
 * 时间戳
 */
public class TimeDemo {
    public static void main(String[] args) {
        //返回的long值是当前系统时间的时间戳
        //对应UTC时间，自1970-01-01 00:00:00到该时间所经过的毫秒
        long time = System.currentTimeMillis();
        System.out.println(time);
        time = time/1000/60/60/24/365;
        System.out.println(time);

        long max = Long.MAX_VALUE;
        max = max/1000/60/60/24/365;
        System.out.println("公元:"+(1970+max));
    }
}



